package com.beiding.hotcode;

import java.util.Collections;
import java.util.Set;

public class HotCodeConfig {

    private String srcRoot;

    private String encoding;

    private Set<String> otherClasspath = Collections.emptySet();

    public HotCodeConfig() {
        //默认使用urf8作为编码字符集
        encoding = "utf8";
    }

    public HotCodeConfig otherClasspath(Set<String> otherClasspath) {
        this.otherClasspath = otherClasspath;
        return this;
    }

    public Set<String> getOtherClasspath() {
        return otherClasspath;
    }

    public String getSrcRoot() {
        if (srcRoot == null) {
            throw new RuntimeException("未指定热编译文件基路径");
        }
        return srcRoot;
    }

    public HotCodeConfig srcRoot(String srcRoot) {
        this.srcRoot = srcRoot;
        return this;
    }

    public String getEncoding() {
        return encoding;
    }

    public HotCodeConfig encoding(String encoding) {
        this.encoding = encoding;
        return this;
    }
}
